﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;
using System.Drawing;

namespace SharppiFlowEditor.models
{
    public class Document
    {

        private ArrayList nodes;
        private ArrayList connectors;
        private string _saveFilePath;
        private Size _documentSize;
        private string _name;
        private static int sharedId = 0;
        private int _id;

        private bool _snapToGridState;
        public bool SnapToGridState
        {
            get { return _snapToGridState; }
            set { _snapToGridState = value; }
        }

        private int _gridWidth = 10;
        public int GridWidth
        {
            get { return _gridWidth; }
            set { _gridWidth = value; }
        }

        public string SaveFilePath
        {
            get { return _saveFilePath; }
            set { _saveFilePath = value; }
        }

        public Size Documentsize
        {
            get { return _documentSize; }
            set { _documentSize = value; }
        }

       // public int Id
       // {
       //     get { return _id; }
       // }

        public string DocumentName
        {
            get { return _name; }
            set { _name = value; }
        }


        public Document()
        {
            nodes = new ArrayList();
            connectors = new ArrayList();
            _saveFilePath = "";
            sharedId++;
        }

        // Get the nodes of the diagram
        public IList Nodes
        {
            get { return nodes; }
        }

        // Get the connectors of the diagram
        public IList Connectors
        {
            get { return connectors; }
        }

        public int SnapX(int x)
        {
            int snapX = x - x % GridWidth;
            return snapX;
        }

        public int SnapY(int y)
        {
            int snapY = y - y % GridWidth;
            return snapY;
        }
    }
}
